import { IsNotEmpty, IsNumber, IsString, IsOptional, Min, Max, MaxLength } from 'class-validator';

export class CreateReviewDto {
  @IsNotEmpty()
  @IsNumber()
  toolId: number;

  @IsNotEmpty()
  @IsNumber()
  @Min(1)
  @Max(5)
  rating: number;

  @IsOptional()
  @IsNumber()
  @Min(1)
  @Max(5)
  performanceRating?: number;

  @IsOptional()
  @IsNumber()
  @Min(1)
  @Max(5)
  priceRating?: number;

  @IsOptional()
  @IsNumber()
  @Min(1)
  @Max(5)
  easeOfUseRating?: number;

  @IsOptional()
  @IsNumber()
  @Min(1)
  @Max(5)
  documentationRating?: number;

  @IsNotEmpty()
  @IsString()
  @MaxLength(2000)
  content: string;

  @IsOptional()
  @IsString()
  @MaxLength(200)
  title?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  useCase?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  teamSize?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  usageDuration?: string;
}

